package com.wang.users.service.impl;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wang.common.pojo.BasePojoEnum;
import com.wang.users.pojo.AtRbacAdmins;
import com.wang.users.pojo.AtRbacAdminsQuery;
import com.wang.users.pojo.AtUsersOrgan;
import com.wang.users.service.AtUsersOperService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * 针对表AtUsersOperServiceImpl的数据库操作Service实现
 *
 * @author ZjxMi
 */
@Service
public class AtUsersOperServiceImpl implements AtUsersOperService {

    /**
     * var zNodes =[
     *         {name:"分页测试", t:"请点击分页按钮", id:"1", count:2000, page:0, pageSize:100, isParent:true}
     *     ];
     * @param dataList 查询对象
     * @return
     */
    @Override
    public JSONArray treeJson(List<AtUsersOrgan> dataList) {
        JSONArray resultArr = new JSONArray();
        for (AtUsersOrgan dataTemp : dataList) {
            JSONObject dataJson = new JSONObject();
            dataJson.put("id", dataTemp.getId());
            dataJson.put("name", dataTemp.getName());
            dataJson.put("parentId", dataTemp.getParentId());
            resultArr.add(dataJson);
        }
        return resultArr;
    }
}